package code.juc.stream;

import javax.swing.plaf.PanelUI;
import java.io.PipedWriter;

/**
 * 写线程
 */
public class ThreadWrite implements Runnable {

    private WriteData writeData;
    private PipedWriter writer;

    public ThreadWrite(WriteData data, PipedWriter writer) {
        this.writeData = data;
        this.writer = writer;
    }

    @Override
    public void run() {
        writeData.writeMethod(writer);
    }
}
